<template>
  <div class="example">
    <transition name="bounce">
      <div class="box" v-show="isShow"></div>
    </transition>
    <div class="btn">
      <button @click="handleClick">{{ isShow ? '隐藏' : '显示' }}</button>
    </div>
  </div>
</template>

<script>
/**
 * 例子 - CSS动画
 */

export default {
  data() {
    return {
      isShow: true
    }
  },
  methods: {
    handleClick() {
      this.isShow = !this.isShow;
    }
  }
}
</script>

<style lang="less" scoped>
@keyframes bounce-in {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}
.bounce-enter-active {
  animation: bounce-in .5s;
}
.bounce-leave-active {
  animation: bounce-in .5s reverse;
}
</style>
